<?php
class editorApi extends baseApi{

	//获取图片上传
	public function get_upload_image($data){
		return model('upload')->get_upload_image($data['button'],$data['id'],$data['editor'],$data['pic']);
	}

	//获取文件上传
	public function get_upload_file($data){
		return model('upload')->get_upload_file($data['button'],$data['id']);
	}

	//获取组图上传
	public function get_upload_images($data){
		return model('upload')->get_upload_images($data['button'],$data['id']);
	}

	//获取编辑器
	public function get_editor($id){
		return model('editor')->get_editor($id);
	}

	//获取图片处理
	public function get_image_cutout($data){
		return model('upload')->get_image_cutout($data['button'],$data['id'],$data['pic']);
	}

	//关联附件
	public function relation($data){
		return model('upload')->relation($data['table'],$data['file_id'],$data['id']);
	}

	//获取关联附件ID
	public function get_relation($data){
		return model('upload')->get_relation($data['table'],$data['id']);
	}

	//删除关联附件
	public function del_file($data){
		return model('upload')->del_file($data['table'],$data['id']);
	}

	//获取文件总数
	public function file_count(){
		return model('upload')->upload_count();
	}

	//添加附件到数据库
	public function upload_add($data){
		return model('upload')->add($data);
	}

}